package action.point;

import service.PointService;
import util.Utilities;
import vo.PointVO;

import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;

public class PointOneSelectAction {
	private PointVO pvo;
	private PointService service;
	private String orderId;
	private String memberId;
	
	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	public String getMemberId() {
		return memberId;
	}
	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}
	
	public PointVO getPvo() {
		return pvo;
	}
	public void setPvo(PointVO pvo) {
		this.pvo = pvo;
	}
	public void setPointService(PointService service) {
		this.service = service;
	}
	
	public String execute() {
		try {
			pvo = service.selectOnePoint(orderId, memberId);
			pvo.setInfo(Utilities.changeTagToText(pvo.getInfo()));
			System.out.println("PointOneSelectAction : "+ pvo.toString());
			return "success";
		} catch(Exception e) {
			e.printStackTrace();
			
			return "error";
		}
		
	}
	
}

